<%--
  Created by IntelliJ IDEA.
  User: www10
  Date: 2022/8/9
  Time: 23:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <script src="${pageContext.request.contextPath}/resource/js/jquery-3.6.0/jquery-3.6.0.js"></script>
    <script src="${pageContext.request.contextPath}/resource/ueditor/useUeEditor.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resource/ueditor/tailor/css/jquery.Jcrop.css"/>
    <script type="text/javascript" charset="utf-8"
            src="${pageContext.request.contextPath}/resource/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8"
            src="${pageContext.request.contextPath}/resource/ueditor/ueditor.all.js"></script>
    <script type="text/javascript" charset="utf-8"
            src="${pageContext.request.contextPath}/resource/ueditor/lang/zh-cn/zh-cn.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resource/layui/css/layui.css"/>
    <script src="${pageContext.request.contextPath}/resource/layui/layui.js"></script>
    <style>
        .hide{
            display: none;
        }
    </style>
    <title>Title</title>
</head>
<body>
<h1>test1</h1>


<div class="layui-form-item">
    <div id="editor" type="text/plain" style="width:100%;height:500px;"></div>
    <textarea id="content" class="hide">${user.name}</textarea>
</div>


</body>

<script>
    var common = {
        data: {
            siteId: "123456"
        },
        init: function () {
            var self = this;
            self.initConsole();
            self.editorConten();
            return this;
        },
        initConsole: function () {
            var self = this;
            console.log(self.data.siteId)
        },
        editorConten: function () {
            var ue = UE.getEditor('editor', {
                elementPathEnabled: false,
                saveInterval: 5000,
                topOffset: 70
            });
            var content = $("#content").val();
            ue.ready(function () {
                //设置编辑器的内容
                ue.setContent(content);
            });
        },


    }.init()

</script>
</html>
